package com.sssta.qinbot.core.plugin;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import com.sssta.qinbot.core.Bot;
import com.sssta.qinbot.model.Group;
import com.sssta.qinbot.model.GroupMessage;
import com.sssta.qinbot.model.Message;

public class SearchPlugin extends PluginBase {

	
	public SearchPlugin(){
		name = "searchPlugin";
		version = "0.1";
		author = "shiminjun";
		descrition = "做一个强大的bot";
		help = "当提到搜索时，bot会帮你搜索，并给你一个传送门";		
		
	}
	@Override
	public boolean onResponse(Message message) {
		if(message.content.toLowerCase().startsWith("@liubot")||message.content.startsWith("@那个帅哥")){
			if (message.content.contains("搜索")) {
				message.reply("http://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&rsv_idx=1&tn=baidu&wd="+java.net.URLEncoder.encode(message.content.substring(message.content.indexOf('索')+1)));
				return true;
			}
		}
		return false;
	}
}

